module.exports = {
  bef: `
// const mtjwxsdk = require("./static/mtj-wx-sdk")
const regeneratorRuntime = require('./static/runtime.js');
const wxp = require('./static/wx.promise.js').default;
const globalInclude = require('./static/global.js');
const globalApi = require('./utils/compile/api.js');
const wxpage = require('./static/wxpage.js');
const wxe = globalInclude.globalUtils.wxe;
let $global = globalInclude.$global;

const createAppDef = require('./utils/compile/app.def.js');

let appDef = createAppDef()

function createApp(def) {
  let ret = {
    ...appDef.init,
    ...def,
  }
  ret.onLaunch = function(options) {
    this.$appOptions = {
      ...options
    }
    this.$systemInfo =  wx.getSystemInfoSync()
    appDef.onLaunch && appDef.onLaunch.call(this, options)
    def.onLaunch && def.onLaunch.call(this, options)
  }
  ret.onShow = function(options) {
    this.$appOptions = {
      ...this.$appOptions,
      ...options
    }
    appDef.onShow && appDef.onShow.call(this, options)
    def.onShow && def.onShow.call(this, options)
  }
  wxpage.A(ret)
}

  `
}
